package com.qingmeng.outsourcing.portal.enums;

import com.qingmeng.outsourcing.common.api.IErrorCode;

/**
 *  用户注册是返回的枚举定义
 */
public enum RegisterResult implements IErrorCode {
    REG_SUCCESS(0,"注册成功"),
    AUTH_CODE_ERROR(1,"验证码错误"),
    USERNAME_EXIST(2,"该用户名已存在"),
    REG_DUPLICATED(3,"该号码已经注册过该身份"),
    REG_FAILED(4,"用户注册失败");

    private final  long code;
    private final String message;

    RegisterResult(long code, String message) {
        this.code = code;
        this.message = message;
    }

    /**
     *获取错误代码
     * @return 错误代码
     */
    @Override
    public long getCode() {
        return code;
    }

    /**
     *获取错误代码对应的相对文本
     * @return 错误代码对应的文本消息
     */
    @Override
    public String getMessage() {
        return message;
    }
}
